#include <pthread.h>
#include <stdio.h>
#include <time.h>


static int count = 0;
void *func (void *arg)
{
    while (count++ < 10)
    {
	printf ("thread id = %lu, count = %d\n", pthread_self (), count);
	pthread_t tid;
	pthread_create(&tid, 0, func, 0);
	printf ("create threadid = %lu\n", tid);
	sleep (1);
    }
}
int main ()
{
    pthread_t tid;
    pthread_create (&tid, 0, func, 0);
    sleep(3);
}
